Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MML 1537: cannot load sv blk files missing armor type field #5634

Conversation

Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented Jun 26, 2024

MM side of fix for various NPEs and loading issues in MegaMek/megameklab#1537.

Fix replaces a magic number in the BLK save code with a defined constant; the code was skipping Standard armor on SVs with Armored Chassis mod and leaving them in an un-loadable state since 0.49.19.

This also adds some handling for fields that had become mismatched between the old SV blk save code and the new loadSV() code, specifically, 'armor_tech[_rating]' which was using the long form to save and the short form to load, leading to undefined behavior.

Finally, there is an MML PR to disable the Armor Tech Rating chooser when non-BAR armor is chosen, to prevent confusion and also stop random fiddling with the chooser causing the Chassis Tech Rating (and thus weight) to fluctuate.

Testing:

  • Loaded previously-failing files after adjusting them manually, then confirmed re-saving them with the patched code fixed all issues.
  • Ran all three projects' unit test suites

@Sleet01 Sleet01 merged commit edaab52 into MegaMek:master Jun 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants